﻿using System;
using System.ComponentModel;
using System.Web.UI.WebControls.WebParts;


using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Generic;
using Microsoft.SharePoint;
using System.Data;
using Microsoft.Office.Server.Search;
using System.Xml.Linq;
using System.Linq;

namespace PeopleSearch.ListPeople
{
    [ToolboxItemAttribute(false)]
    public partial class ListPeople : WebPart
    {
        // Uncomment the following SecurityPermission attribute only when doing Performance Profiling on a farm solution
        // using the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
        // for production. Because the SecurityPermission attribute bypasses the security check for callers of
        // your constructor, it's not recommended for production purposes.
        // [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
        public ListPeople()
        {
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            InitializeControl();
        }

        public  SPWeb mySite;
        public  SPUserCollection alluser;
        public  List<string> userName = new List<string>();

        protected void Page_Load(object sender, EventArgs e)
        {
            getvalues("");
        }

        public void getvalues(string searchPeople)
        {
            mySite = SPContext.Current.Web;
            alluser = mySite.AllUsers;
          
            foreach (SPUser item in alluser)
            {
                userName.Add(item.Name);
            }
        }    
    }
}
